// 第一步：引入createRouter
import {createRouter,createWebHistory} from 'vue-router'
import Sysuser from '@/views/sys/user/index.vue'
import Admiin from '@/layouts/admin.vue'
import Login from '@/page/Login.vue'
import Register from '@/page/Register.vue'
import ShopList from '@/views/shop/index.vue'
import CartList from '@/views/shop/components/cartlist.vue'

const router = createRouter({
    history:createWebHistory(), //路由器的工作模式（稍后讲解）
    routes:[
        {   path:"/",
            component:Admiin,
            children:[
                {
                    path:"/sys/user",
                    component:Sysuser,
                }
            ]
        },
        {
            path:"/login",
            component: Login
        },
        {
            path:"/register",
            component: Register
        },
        {
            path:"/shop/list",
            component: ShopList
        }
        ,
        {
            path:"/shop/cart",
            component: CartList
        }
    ]
})


// 暴露出去router
export default router